<template>
	<form-group title="商户编号" :left="left">
		<select class="form-control" name="mchtIdFlag" v-el:id  @change="watcher">
			<option v-for="item in mainList" :value="item.value">
				{{item.key}}
			</option>
		</select>
	</form-group>
</template>


<script>
export default {
		props: {
			mainList: {
				type: Array
			},
			left: {
				type:String,
				default:function() {
					return "3"
				}
			}
		},
		methods: {
			watcher() {
				let data = this.get();
				this.$dispatch("mid-watcher",data);
			},
			get() {
				return this.$els.id.value;
			}
		},
	  beforeCompile() {
		  this.$post({
				url:"/api/v1" + projectName_Url + "/list/mchtAll.html"
			}).then((response)=>{
			},response=>{
				let list = response.info;
				this.$set("mainList",list);
				this.$nextTick(()=>{
					 this.$dispatch("mid-done");
				})
			})
		}
}
</script>
